﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.SetTemplateAndKeywords.CUISetTemplateAndKeywordsCopyDialog
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.SetTemplateAndKeywords;

internal class CUISetTemplateAndKeywordsCopyDialog : TxForm
{
  private TxRobot m_robot;
  private List<ITxRoboticOperation> m_operations;
  internal ITxRoboticOperation m_selecetdOperation;
  private IContainer components;
  private Label label1;
  private Button OK_button;
  private Button Cancel_button;
  private TxObjEditBoxCtrl txObjEditBoxCtrlOp;

  internal CUISetTemplateAndKeywordsCopyDialog(TxRobot robot, List<ITxRoboticOperation> operations)
  {
    this.InitializeComponent();
    this.m_robot = robot;
    this.m_operations = operations;
  }

  public virtual void OnInitTxForm()
  {
    // ISSUE: unable to decompile the method.
  }

  private void Cancel_button_Click(object sender, EventArgs e) => ((Form) this).Close();

  private void OK_button_Click(object sender, EventArgs e)
  {
    this.m_selecetdOperation = this.txObjEditBoxCtrlOp.Object as ITxRoboticOperation;
    ((Form) this).Close();
  }

  private void txObjEditBoxCtrlOp_Picked(object sender, TxObjEditBoxCtrl_PickedEventArgs args)
  {
    this.UpdateOKButton();
  }

  private void UpdateOKButton()
  {
    if (this.txObjEditBoxCtrlOp.Object != null)
      this.OK_button.Enabled = true;
    else
      this.OK_button.Enabled = false;
  }

  private void txObjEditBoxCtrlOp_Validated(object sender, EventArgs e) => this.UpdateOKButton();

  private void txObjEditBoxCtrlOp_TypeInvalid(object sender, EventArgs e) => this.UpdateOKButton();

  private void txObjEditBoxCtrlOp_TypeValid(object sender, EventArgs e) => this.UpdateOKButton();

  protected virtual void Dispose(bool disposing)
  {
    if (disposing && this.components != null)
      this.components.Dispose();
    base.Dispose(disposing);
  }

  private void InitializeComponent()
  {
    ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CUISetTemplateAndKeywordsCopyDialog));
    this.label1 = new Label();
    this.OK_button = new Button();
    this.Cancel_button = new Button();
    this.txObjEditBoxCtrlOp = new TxObjEditBoxCtrl();
    ((Control) this).SuspendLayout();
    this.label1.AutoSize = true;
    this.label1.Location = new Point(5, 12);
    this.label1.Name = "label1";
    this.label1.Size = new Size(57, 13);
    this.label1.TabIndex = 0;
    this.label1.Text = "Copy from:";
    this.OK_button.Location = new Point(108, 35);
    this.OK_button.Name = "OK_button";
    this.OK_button.Size = new Size(75, 23);
    this.OK_button.TabIndex = 2;
    this.OK_button.Text = "OK";
    this.OK_button.UseVisualStyleBackColor = true;
    this.OK_button.Click += new EventHandler(this.OK_button_Click);
    this.Cancel_button.Location = new Point(189, 35);
    this.Cancel_button.Name = "Cancel_button";
    this.Cancel_button.Size = new Size(75, 23);
    this.Cancel_button.TabIndex = 3;
    this.Cancel_button.Text = "Cancel";
    this.Cancel_button.UseVisualStyleBackColor = true;
    this.Cancel_button.Click += new EventHandler(this.Cancel_button_Click);
    this.txObjEditBoxCtrlOp.ListenToPick = false;
    ((Control) this.txObjEditBoxCtrlOp).Location = new Point(68, 9);
    ((Control) this.txObjEditBoxCtrlOp).Name = "txObjEditBoxCtrlOp";
    this.txObjEditBoxCtrlOp.Object = (ITxObject) null;
    this.txObjEditBoxCtrlOp.PickAndClear = false;
    this.txObjEditBoxCtrlOp.PickLevel = (TxPickLevel) 1;
    this.txObjEditBoxCtrlOp.PickOnly = false;
    this.txObjEditBoxCtrlOp.ReadOnly = false;
    ((Control) this.txObjEditBoxCtrlOp).Size = new Size(196, 20);
    ((Control) this.txObjEditBoxCtrlOp).TabIndex = 1;
    this.txObjEditBoxCtrlOp.ValidatorType = (TxValidatorType) 1;
    this.txObjEditBoxCtrlOp.TypeInvalid += new EventHandler(this.txObjEditBoxCtrlOp_TypeInvalid);
    this.txObjEditBoxCtrlOp.TypeValid += new EventHandler(this.txObjEditBoxCtrlOp_TypeValid);
    this.txObjEditBoxCtrlOp.Picked += new TxObjEditBoxCtrl_PickedEventHandler(this.txObjEditBoxCtrlOp_Picked);
    ((Control) this.txObjEditBoxCtrlOp).Validated += new EventHandler(this.txObjEditBoxCtrlOp_Validated);
    ((ContainerControl) this).AutoScaleDimensions = new SizeF(6f, 13f);
    ((ContainerControl) this).AutoScaleMode = AutoScaleMode.Font;
    ((Form) this).ClientSize = new Size(276, 70);
    ((Control) this).Controls.Add((Control) this.txObjEditBoxCtrlOp);
    ((Control) this).Controls.Add((Control) this.Cancel_button);
    ((Control) this).Controls.Add((Control) this.OK_button);
    ((Control) this).Controls.Add((Control) this.label1);
    ((Form) this).FormBorderStyle = FormBorderStyle.FixedDialog;
    ((Form) this).Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
    ((Form) this).MaximizeBox = false;
    ((Form) this).MinimizeBox = false;
    ((Control) this).Name = nameof (CUISetTemplateAndKeywordsCopyDialog);
    this.ShouldCloseOnDocumentUnloading = true;
    ((Control) this).Text = "Copy Template and Keywords";
    ((Form) this).TopMost = true;
    ((Control) this).ResumeLayout(false);
    ((Control) this).PerformLayout();
  }
}
